package com.comtop.springboot.templet.modules.sys.controller;

import com.baomidou.mybatisplus.plugins.Page;
import com.comtop.springboot.templet.common.controller.AbstractController;
import com.comtop.springboot.templet.common.utils.Ret;
import com.comtop.springboot.templet.modules.sys.entity.SysLogEntity;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;


/**
 * 系统日志
 * 
 * @author wangjiafang
 * @version 1.0
 * @since 2017-03-08 10:40:56
 */

@RestController
@RequestMapping("/sys/log")
public class SysLogController extends AbstractController {
	/**日志服务**/
	@Autowired
	private com.comtop.springboot.templet.modules.sys.service.ISysLogService ISysLogService;
	
	/**
	 * 列表
	 */
	@GetMapping("/list")
	@RequiresPermissions("sys:log:list")
	public Ret list(@RequestParam Map<String, Object> params){
		//当前页
		int current = Integer.parseInt(params.get("current").toString());
		//每页条数
		int size = Integer.parseInt(params.get("size").toString());

		Page<SysLogEntity> sysLogEntityPage = ISysLogService.selectSysLogList(new Page<>(current, size), params);

		return Ret.ok().put("page", sysLogEntityPage);
	}
	
}
